#include "Pacs_MainInfoWidget.h"
#include "Pacs_EditReportWidget.h"
#include "Pacs_CreateNewSick.h"
#include "Pacs_FindSickWidget.h"
#include <QVBoxLayout>
#include "PacsClient.h"
Pacs_MainInfoWidget::Pacs_MainInfoWidget(QWidget *parent)
	: QWidget(parent)
{
	ui.setupUi(this);
	m_editReportWidget  = new Pacs_EditReportWidget;
	ui.editReportVerticalLayout->addWidget(m_editReportWidget);
	m_sickInfoWidget = new Pacs_CreateNewSick;
	ui.verticalLayout_4->setAlignment(Qt::AlignLeft);
	ui.verticalLayout_4->addWidget(m_sickInfoWidget);
	m_findSickWidget = new Pacs_FindSickWidget;
	ui.verticalLayout_3->setAlignment(Qt::AlignLeft);
	ui.verticalLayout_3->addWidget(m_findSickWidget);
	ui.SickInfoTabWidget->setCurrentIndex(0);
	connect(PacsClient::getClientInstance(), &PacsClient::createNewPatient, this, &Pacs_MainInfoWidget::SetCurrentPatient);
	
}


void Pacs_MainInfoWidget::SetCurrentPatient(const QString& strCheckNum)
{
	m_editReportWidget->setCurrentPaientInfo();
	ui.SickInfoTabWidget->setCurrentIndex(0);
}

Pacs_MainInfoWidget::~Pacs_MainInfoWidget()
{
	delete m_editReportWidget;
	delete m_sickInfoWidget;
	delete m_findSickWidget;
}
